package com.zyb.calculator;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {

	double op1;
	double op2;
	char lastoperator;
	int flag;
	TextView tvresult;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        flag=0;
        tvresult=(TextView)findViewById((R.id.result));
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    public void Cleardata(View v)
    {
    	op1=op2=0;
    	flag=0;
    	tvresult.setText("");
    }
    
    public void GetNumber(View v)
    {
    	Button btn=(Button)v;
    	tvresult.setText(tvresult.getText().toString()+btn.getText());
    }
    public void Operation(View v)
    {
    	
    }
    public void getResult(View v)
    {
    	
    }
    public void Turn(View v)
    {
    	Double temp=Double.parseDouble(tvresult.getText().toString());
    	temp=temp*-1;
    	tvresult.setText(temp.toString());
    	
    }

    
}
